Optimal. Leaf size=158 \[ -\frac {B (b c-a d) h (3 b d g-b c h-a d h) n x}{3 b^2 d^2}-\frac {B (b c-a d) h^2 n x^2}{6 b d}-\frac {B (b g-a h)^3 n \log (a+b x)}{3 b^3 h}+\frac {B (d g-c h)^3 n \log (c+d x)}{3 d^3 h}+\frac {(g+h x)^3 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )}{3 h} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.11, antiderivative size = 158, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.065, Rules used = {2548, 84}
\begin {gather*} \frac {(g+h x)^3 \left (B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A\right )}{3 h}-\frac {B n (b g-a h)^3 \log (a+b x)}{3 b^3 h}-\frac {B h n x (b c-a d) (-a d h-b c h+3 b d g)}{3 b^2 d^2}-\frac {B h^2 n x^2 (b c-a d)}{6 b d}+\frac {B n (d g-c h)^3 \log (c+d x)}{3 d^3 h} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 84
Rule 2548
Rubi steps
\begin {align*} \int (g+h x)^2 \left (A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx &=\int \left (A (g+h x)^2+B (g+h x)^2 \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right ) \, dx\\ &=\frac {A (g+h x)^3}{3 h}+B \int (g+h x)^2 \log \left (e (a+b x)^n (c+d x)^{-n}\right ) \, dx\\ &=\frac {A (g+h x)^3}{3 h}+\frac {B (g+h x)^3 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{3 h}-\frac {(B (b c-a d) n) \int \frac {(g+h x)^3}{(a+b x) (c+d x)} \, dx}{3 h}\\ &=\frac {A (g+h x)^3}{3 h}+\frac {B (g+h x)^3 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{3 h}-\frac {(B (b c-a d) n) \int \left (\frac {h^2 (3 b d g-b c h-a d h)}{b^2 d^2}+\frac {h^3 x}{b d}+\frac {(b g-a h)^3}{b^2 (b c-a d) (a+b x)}+\frac {(d g-c h)^3}{d^2 (-b c+a d) (c+d x)}\right ) \, dx}{3 h}\\ &=-\frac {B (b c-a d) h (3 b d g-b c h-a d h) n x}{3 b^2 d^2}-\frac {B (b c-a d) h^2 n x^2}{6 b d}+\frac {A (g+h x)^3}{3 h}-\frac {B (b g-a h)^3 n \log (a+b x)}{3 b^3 h}+\frac {B (d g-c h)^3 n \log (c+d x)}{3 d^3 h}+\frac {B (g+h x)^3 \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{3 h}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.14, size = 195, normalized size = 1.23 \begin {gather*} \frac {2 a B d^3 \left (3 b^2 g^2-3 a b g h+a^2 h^2\right ) n \log (a+b x)-2 b^3 B c \left (3 d^2 g^2-3 c d g h+c^2 h^2\right ) n \log (c+d x)+b d x \left (B (b c-a d) h n (-6 b d g+2 b c h+2 a d h-b d h x)+2 A b^2 d^2 \left (3 g^2+3 g h x+h^2 x^2\right )+2 b^2 B d^2 \left (3 g^2+3 g h x+h^2 x^2\right ) \log \left (e (a+b x)^n (c+d x)^{-n}\right )\right )}{6 b^3 d^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 9 vs. order
3.
time = 0.38, size = 1425, normalized size = 9.02
method | result | size |
risch | \(\text {Expression too large to display}\) | \(1425\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 300 vs.
\(2 (149) = 298\).
time = 0.29, size = 300, normalized size = 1.90 \begin {gather*} \frac {1}{3} \, B h^{2} x^{3} \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + \frac {1}{3} \, A h^{2} x^{3} + B g h x^{2} \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A g h x^{2} + {\left (\frac {a n e \log \left (b x + a\right )}{b} - \frac {c n e \log \left (d x + c\right )}{d}\right )} B g^{2} e^{\left (-1\right )} - {\left (\frac {a^{2} n e \log \left (b x + a\right )}{b^{2}} - \frac {c^{2} n e \log \left (d x + c\right )}{d^{2}} + \frac {{\left (b c n - a d n\right )} x e}{b d}\right )} B g h e^{\left (-1\right )} + \frac {1}{6} \, {\left (\frac {2 \, a^{3} n e \log \left (b x + a\right )}{b^{3}} - \frac {2 \, c^{3} n e \log \left (d x + c\right )}{d^{3}} - \frac {{\left (b^{2} c d n - a b d^{2} n\right )} x^{2} e - 2 \, {\left (b^{2} c^{2} n - a^{2} d^{2} n\right )} x e}{b^{2} d^{2}}\right )} B h^{2} e^{\left (-1\right )} + B g^{2} x \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right ) + A g^{2} x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 325 vs.
\(2 (149) = 298\).
time = 0.37, size = 325, normalized size = 2.06 \begin {gather*} \frac {2 \, {\left (A + B\right )} b^{3} d^{3} h^{2} x^{3} + {\left (6 \, {\left (A + B\right )} b^{3} d^{3} g h - {\left (B b^{3} c d^{2} - B a b^{2} d^{3}\right )} h^{2} n\right )} x^{2} + 2 \, {\left (3 \, {\left (A + B\right )} b^{3} d^{3} g^{2} - {\left (3 \, {\left (B b^{3} c d^{2} - B a b^{2} d^{3}\right )} g h - {\left (B b^{3} c^{2} d - B a^{2} b d^{3}\right )} h^{2}\right )} n\right )} x + 2 \, {\left (B b^{3} d^{3} h^{2} n x^{3} + 3 \, B b^{3} d^{3} g h n x^{2} + 3 \, B b^{3} d^{3} g^{2} n x + {\left (3 \, B a b^{2} d^{3} g^{2} - 3 \, B a^{2} b d^{3} g h + B a^{3} d^{3} h^{2}\right )} n\right )} \log \left (b x + a\right ) - 2 \, {\left (B b^{3} d^{3} h^{2} n x^{3} + 3 \, B b^{3} d^{3} g h n x^{2} + 3 \, B b^{3} d^{3} g^{2} n x + {\left (3 \, B b^{3} c d^{2} g^{2} - 3 \, B b^{3} c^{2} d g h + B b^{3} c^{3} h^{2}\right )} n\right )} \log \left (d x + c\right )}{6 \, b^{3} d^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: HeuristicGCDFailed} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.47, size = 372, normalized size = 2.35 \begin {gather*} x^2\,\left (\frac {3\,A\,a\,d\,h^2+3\,A\,b\,c\,h^2+6\,A\,b\,d\,g\,h+B\,a\,d\,h^2\,n-B\,b\,c\,h^2\,n}{6\,b\,d}-\frac {A\,h^2\,\left (3\,a\,d+3\,b\,c\right )}{6\,b\,d}\right )+\ln \left (\frac {e\,{\left (a+b\,x\right )}^n}{{\left (c+d\,x\right )}^n}\right )\,\left (B\,g^2\,x+B\,g\,h\,x^2+\frac {B\,h^2\,x^3}{3}\right )-x\,\left (\frac {\left (3\,a\,d+3\,b\,c\right )\,\left (\frac {3\,A\,a\,d\,h^2+3\,A\,b\,c\,h^2+6\,A\,b\,d\,g\,h+B\,a\,d\,h^2\,n-B\,b\,c\,h^2\,n}{3\,b\,d}-\frac {A\,h^2\,\left (3\,a\,d+3\,b\,c\right )}{3\,b\,d}\right )}{3\,b\,d}-\frac {3\,A\,a\,c\,h^2+3\,A\,b\,d\,g^2+6\,A\,a\,d\,g\,h+6\,A\,b\,c\,g\,h+3\,B\,a\,d\,g\,h\,n-3\,B\,b\,c\,g\,h\,n}{3\,b\,d}+\frac {A\,a\,c\,h^2}{b\,d}\right )+\frac {A\,h^2\,x^3}{3}+\frac {\ln \left (a+b\,x\right )\,\left (B\,n\,a^3\,h^2-3\,B\,n\,a^2\,b\,g\,h+3\,B\,n\,a\,b^2\,g^2\right )}{3\,b^3}-\frac {\ln \left (c+d\,x\right )\,\left (B\,n\,c^3\,h^2-3\,B\,n\,c^2\,d\,g\,h+3\,B\,n\,c\,d^2\,g^2\right )}{3\,d^3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________